﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Log.Core
{
    /// <summary>
    /// 日志追加器接口
    /// </summary>
    /// <remarks>通过实现日志追加器接口来实现自定义的日志语句输出策略</remarks>
    /// <history>
    /// [zanezeng]               2009/9/7 9:15    创建
    /// </history>
    public interface ILogAppender : ILogFilterAttachable, IDisposable
    {
        #region ---Property

        /// <summary>
        /// 获得日志追加器的名称
        /// </summary>
        /// <value>日志追加器的名称</value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/25 12:29    创建
        /// </history>
        string Name
        {
            get;
        }

        /// <summary>
        /// 获得或者设置设置当前日志追加器是否可用
        /// </summary>
        /// <value>
        /// 	<c>true</c>：日志追加器可用<br/>
        /// 	<c>false</c>：日志追加器不可用
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/25 12:27    创建
        /// </history>
        bool IsEnabled
        {
            get;
            set;
        }

        /// <summary>
        /// 获得一个值，该值用于判断当前日志记录器是否已经被关闭
        /// </summary>
        /// <value>
        /// 	<c>true</c>：日志记录器已经被关闭<br/>
        /// 	<c>false</c>：日志记录器尚未被关闭
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/9 16:57    创建
        /// </history>
        bool IsClosed
        {
            get;
        }

        #endregion

        #region ---Methods

        /// <summary>
        /// 向当前的日志追加器中添加一条日志记录
        /// </summary>
        /// <param name="entry">要添加到当前日志追加器中的日志记录</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/22 17:42    创建
        /// </history>
        void Append(LogEntry entry);

        /// <summary>
        /// 关闭当前日志记录器
        /// </summary>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/25 14:52    创建
        /// </history>
        void Close();

        #endregion
    }
}
